<%@ page language="java" import="java.util.*, com.rmt.www.vo.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'detail.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<script src="js/jquery-1.7.1.js"></script>
		<script src="js/jquery-ui-1.8.18.custom.min.js"></script>
		<link href="css/jquery-ui-1.8.18.custom.css" rel="stylesheet"
			type="text/css" />
		<link href="css/Site.css" rel="stylesheet"
            type="text/css" />
		<script>
			$(function() {
				//设置样式为JQuery UI的tab组件样式
				$('#tabs').tabs({
			  		select: function(event, ui) {
				  	 	$('input:checked').each(function(){
				  	 		$(this).attr('checked',false);
				  	 	});
			  	 	}
			  	 });
				//注册detailInfo按钮点击事件处理函数
				$('input[value="detailInfo"]').click(function(){
						var i=$('input:checked').length;
						if(i!=1){
							alert('please choose exactly one artifact!');
						}else{
							var aid;
							var url='detailInfo?aid=';
							$('input:checked').each(function(){
								aid=$(this).attr('value');
								url+=aid;
							});
							var td = $("input:checked").parent();
							//获取当前选择的Artifact的类型
			    			var artifacttype = td.children().eq(1).attr('value');
			    			url=url+'&artifacttype='+artifacttype;
			    			//调用后台detailInfo的execute()处理，获得选中的Artifact的详细信息
							$.ajax({
							  url:url ,
							  cache: false
							}).done(function(html){
								$('#detailInfo').html(html);
							});
						}
				});
			});
		</script>

	</head>
	<body>
	<div class='page' id='wrap'>
	<div id="header" style='background-color: #5c87b2'>
            <div id="title" >
                <h1>&nbsp;&nbsp;RMT Service for administrator</h1>
            </div>
              
            
                <div id="logindisplay">
                welcome <%=((User)session.getAttribute("currentUser")).getName()%>,  <a href='../RMT'>logout</a>
             	 </div>
             	 <div id="menucontainer">
            	<br/>
            	<br/>
                <ul id="menu">
                	<li><a href="adminHomeAction">Home</a></li>              
                    <li><a href='getProjectsForAdmin'>projects</a></li>
                    <li><a href='accountManageAction?manageTarget=account'>users</a></li>
                </ul>
            	
            	</div>
        </div>
   
		<div id="tabs">
			<ul>
				<li>
					<a href="#feature"><span>FEATURE</span> </a>
				</li>
				<li>
					<a href="#requirement"><span>REQUIREMENT</span> </a>
				</li>
				<li>
					<a href="#design"><span>DESIGN</span> </a>
				</li>
				<li>
					<a href="#implementation"><span>IMPLEMENTATION</span> </a>
				</li>
				<li>
					<a href="#testCase"><span>TEST CASE</span> </a>
				</li>
			</ul>

			<div id='feature'>
				<table border="1">
					<tr>
						<th>
							choose
						</th>
						<th>
							title
						</th>
						<th>
							author
						</th>
						<th>
							status
						</th>
						<th>
							version
						</th>
						<th>
							priority
						</th>
					</tr>
					<s:iterator value="featureList" id="list" status="st">
						<tr>
							<td>
								<input type="checkbox" value='<s:property value="#list.id" />' />
								<input type="hidden" value='<s:property value="#list.artifacttype" />' />
							</td>
							<td>
								<s:property value="#list.title" />
							</td>
							<td>
								<s:property value="#list._authorname" />
							</td>
							<td>
								<s:property value="#list.status" />
							</td>
							<td>
								<s:property value="#list.version" />
							</td>
							<td>
								<s:property value="#list.priority" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value='detailInfo' />
			</div>
			<div id='requirement'>
				<table border="1">
					<tr>
						<th>
							choose
						</th>
						<th>
							title
						</th>
						<th>
							author
						</th>
						<th>
							status
						</th>
						<th>
							version
						</th>
						<th>
							priority
						</th>
					</tr>
					<s:iterator value="requirementList" id="list" status="st">
						<tr>
							<td>
								<input type="checkbox" value='<s:property value="#list.id" />' />
								<input type="hidden" value='<s:property value="#list.artifacttype" />' />
							</td>
							<td>
								<s:property value="#list.title" />
							</td>
							<td>
								<s:property value="#list._authorname" />
							</td>
							<td>
								<s:property value="#list.status" />
							</td>
							<td>
								<s:property value="#list.version" />
							</td>
							<td>
								<s:property value="#list.priority" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value='detailInfo' />
			</div>
			<div id='design'>
				<table border="1">
					<tr>
						<th>
							choose
						</th>
						<th>
							title
						</th>
						<th>
							author
						</th>
						<th>
							status
						</th>
						<th>
							function
						</th>
						<th>
							version
						</th>
						<th>
							priority
						</th>
					</tr>
					<s:iterator value="designList" id="list" status="st">
						<tr>
							<td>
								<input type="checkbox" value='<s:property value="#list.id" />' />
								<input type="hidden" value='<s:property value="#list.artifacttype" />' />
							</td>
							<td>
								<s:property value="#list.title" />
							</td>
							<td>
								<s:property value="#list._authorname" />
							</td>
							<td>
								<s:property value="#list.status" />
							</td>
							<td>
								<s:property value="#list.function" />
							</td>
							<td>
								<s:property value="#list.version" />
							</td>
							<td>
								<s:property value="#list.priority" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value='detailInfo' />
			</div>
			<div id='implementation'>
				<table border="1">
					<tr>
						<th>
							choose
						</th>
						<th>
							title
						</th>
						<th>
							author
						</th>
						<th>
							status
						</th>
						<th>
							function
						</th>
						<th>
							language
						</th>
						<th>
							version
						</th>
						<th>
							priority
						</th>
					</tr>
					<s:iterator value="implementationList" id="list" status="st">
						<tr>
							<td>
								<input type="checkbox" value='<s:property value="#list.id" />' />
								<input type="hidden" value='<s:property value="#list.artifacttype" />' />
							</td>
							<td>
								<s:property value="#list.title" />
							</td>
							<td>
								<s:property value="#list._authorname" />
							</td>
							<td>
								<s:property value="#list.status" />
							</td>
							<td>
								<s:property value="#list.function" />
							</td>
							<td>
								<s:property value="#list.language" />
							</td>
							<td>
								<s:property value="#list.version" />
							</td>
							<td>
								<s:property value="#list.priority" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value='detailInfo' />
			</div>
			<div id='testCase'>
				<table border="1">
					<tr>
						<th>
							choose
						</th>
						<th>
							title
						</th>
						<th>
							author
						</th>
						<th>
							status
						</th>
						<th>
							version
						</th>
						<th>
							priority
						</th>
					</tr>
					<s:iterator value="testcaseList" id="list" status="st">
						<tr>
							<td>
								<input type="checkbox" value='<s:property value="#list.id" />' />
								<input type="hidden" value='<s:property value="#list.artifacttype" />' />
							</td>
							<td>
								<s:property value="#list.title" />
							</td>
							<td>
								<s:property value="#list._authorname" />
							</td>
							<td>
								<s:property value="#list.status" />
							</td>
							<td>
								<s:property value="#list.version" />
							</td>
							<td>
								<s:property value="#list.priority" />
							</td>
						</tr>
					</s:iterator>
				</table>
				<input type="button" value='detailInfo' />
			</div>
		</div>

	<div id='detailInfo' style="min-height: 100">
	</div>
	<div class="push"></div>
  	<div id="footer" style="background-color:#5c87b2">
  	  <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border:hidden;background-color:#5c87b2;">							
		<tbody style="border:hidden">
			<tr style="border: hidden">	
				<td width="160" style="border: hidden">&nbsp;</td>											   		<td>									
				<table width="60%" border="0" cellspacing="0" cellpadding="0" style="border:hidden;">	
					<tbody style="border: hidden">
						<tr style="border: hidden">
							<td height="20px"><font color='#ffffff'>©2012 Copyright NJU SEI RMT team</font></td>										
						</tr>										
						<tr style="border: hidden">											
							<td height="20px"><font color='#ffffff'>2012 graduation project: requirement management tool</font></td>	
						</tr>										
						<tr style="border: hidden">					
							<td height="20px"><font color='#ffffff'>project homepage：http://code.google.com/p/rmt-ss/</font></td>		
						</tr>									
					</tbody>
				</table>								
				</td>							
			</tr>						
		</tbody>
	</table>	
  	</div>
	</div>
	</body>
</html>
